package cn.psvmc.cxzapi.model.order;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 订单账单表
 * @Author auto
 * @Date 2024-08-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_order_bill")
public class TOrderBill implements Serializable {

    @Serial
    private static final long serialVersionUID = -1366118704122135294L;
    //订单账单id
    @TableId(value = "obid", type = IdType.AUTO)
    private Integer obid;

    //流水号
    @TableField("transaction_id")
    private String transactionId;

    //支付宝交易号
    @TableField("trade_no")
    private String tradeNo;

    //是否生成支付宝账单（0未生成 1已生成）
    @TableField("is_generate")
    private Integer isGenerate;

    //订单id
    @TableField("order_id")
    private Integer orderId;

    //租期（第几期）
    @TableField("period")
    private Integer period;

    //原租期
    @TableField("old_period")
    private Integer oldPeriod;

    //支付方式（1支付宝免密支付2花呗分期）
    @TableField("pay_way")
    private Integer payWay;

    //支付类型（1手动支付 2押金转支付）
    @TableField("pay_type")
    private Integer payType;

    //开始时间
    @TableField("begin_time")
    private LocalDateTime beginTime;

    //结束时间
    @TableField("end_time")
    private LocalDateTime endTime;

    //预计扣款日
    @TableField("plan_date")
    private String planDate;

    //实际支付日
    @TableField("real_date")
    private String realDate;

    //账单金额
    @TableField("bill_amount")
    private Double billAmount;

    //原始账单金额
    @TableField("old_amount")
    private Double oldAmount;

    //押金转支付金额
    @TableField("deposit_pay")
    private Double depositPay;

    //商户实际退回金额
    @TableField("send_back_fee")
    private Double sendBackFee;

    //可用金额
    @TableField("available_amount")
    private Double availableAmount;

    //付款金额
    @TableField("pay_amount")
    private Double payAmount;

    //商家结算金额
    @TableField("store_amount")
    private Double storeAmount;

    //平台收成金额
    @TableField("platform_amount")
    private Double platformAmount;

    //结算时间
    @TableField("cut_time")
    private LocalDateTime cutTime;

    //支付宝交易状态（0等待支付 1支付成功 2退款成功 3交易关闭）
    @TableField("trade_status")
    private Integer tradeStatus;

    //账单状态（0待支付1已支付2已退款22部分退款3已关闭）
    @TableField("bill_status")
    private Integer billStatus;

    //扣款次数
    @TableField("num")
    private Integer num;

    //付款人id
    @TableField("userid")
    private String userid;

    //付款时间
    @TableField("pay_time")
    private LocalDateTime payTime;

    //商家id
    @TableField("storeid")
    private Integer storeid;

    //创建人id
    @TableField(value = "createid", fill = FieldFill.INSERT)
    private Integer createid;

    //创建时间
    @TableField(value = "createtime", fill = FieldFill.INSERT)
    private LocalDateTime createtime;

    //是否续租（0否 1是）
    @TableField("renew_bill")
    private Integer renewBill;

    //日志
    @TableField(exist = false)
    private String comm;

    //附件
    @TableField(exist = false)
    private String filePath;

    //订单号
    @TableField(exist = false)
    private String orderCode;

    //申请更换后的期数
    @TableField(exist = false)
    private Integer newPeriod;

    //客户id
    @TableField(exist = false)
    private Integer customerid;

    //所属商品id
    @TableField(exist = false)
    private Integer goodsId;

    //买断价格
    @TableField(exist = false)
    private Double buyPrice;

    //类型（1普通订单2买断订单3赔偿款4运费5补租金）
    @TableField(exist = false)
    private Integer orderType;

    //总租金
    @TableField(exist = false)
    private Double rent;

    //优惠后总租金
    @TableField(exist = false)
    private Double rentAfterCoupon;

    //分期单号
    @TableField("installment_order_id")
    private String installmentOrderId;

    //交易组件订单号
    @TableField(exist = false)
    private String tradeComponentOrderId;

    //支付宝授权资金订单号
    @TableField(exist = false)
    private String authNo;

    //支付宝唯一用户标识
    @TableField(exist = false)
    private String openid;

    //分期阶段编码
    @TableField("stage_no")
    private Long stageNo;

    //本次分期号
    @TableField("installment_no")
    private Integer installmentNo;

    //是否确认（0未确认 1已确认）
    @TableField(exist = false)
    private Integer confirmed;

    //订单附加信息
    @TableField(exist = false)
    private String body;
}
